home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
701-725
/
718
/
bootpic
/
bootpic_source.lz
/
dev_support.i
< prev
next >
Wrap
Text File
|
1992-08-13
|
5KB
|
186 lines
*
* rev 0.1b Doc-Bug: c_a_d braucht d0 als parameter
*
rsreset
ln rs.b 0
ln_succ rs.l 1
ln_pred rs.l 1
ln_type rs.b 1
ln_pri rs.b 1
ln_name rs.l 1
ln_size rs.l 0
nt_msgport equ 4
nt_message equ 5
rsreset
mp rs.b ln_size
mp_flags rs.b 1
mp_sigbit rs.b 1
mp_sigtask rs.l 1
mp_msglist rs.b 14
rsreset
mn rs.b ln_size
mn_replyport rs.l 1
mn_length rs.w 1
mn_size rs.w 0
rsreset
iostdrequest rs.l 0
io_message rs.b mn_size
io_device rs.l 1
io_unit rs.l 1
io_command rs.w 1
io_flags rs.b 1
io_error rs.b 1
io_size rs.l 0
rsreset
td rs.l 0
td_io rs.b io_size
tv_secs rs.l 1
tv_micro rs.l 1
*****************************************************************
* open_a_device öffnet Device und initialisiert Messageport *
* d0=länge des Speicherblocks *
* d1=devicflags *
* d2=deviceunit *
* a0=devicenmae *
* *
* d0=0 => error else d0=pointer to iorequest *
*****************************************************************
* close_a_device schließt ein device und gibt Messageport frei *
* a1=iorequest *
* d0=länge des Speicherblocks *
* kein Ergebnis *
*****************************************************************
*= Memhandling: messageport in front of iorequest_structure =
*= =
*****************************************************************
* createport intialisiert messageport *
* a0=pointer to enough memory *
*****************************************************************
* deleteport frees messageport *
* a0=pointer to port *
*****************************************************************
device_support macro
open_a_device
movem.l d4-d7,-(sp)
move.l a0,d4
move.l d1,d5
move.l d0,d6
move.l 4.w,a6
move.l #$10000,d1
add.l #34,d0
jsr _lvoallocmem(a6)
move.l d0,d7
beq od_nomsgmem
move.l d0,a0
moveq #0,d0
sub.l a1,a1
bsr createport
tst.l d0
beq od_noport
add.l #34,d7
move.l d7,a1
move.l a0,mn_replyport(a1)
move.w d6,mn_length(a1)
move.b #nt_message,ln_type(a1)
move.l d2,d0
move.l d4,a0
move.l d5,d1
jsr _lvoopendevice(a6)
tst.l d0
beq.s od_ok
od_error
move.l d7,a0
sub.l #34,d7
bsr deleteport
add.l #34,d7
bra.s od_noport ;neu !!!!!
od_nomsgmem
moveq.l #0,d7 ;in q.l umgeändert
od_ok
move.l d7,d0
movem.l (sp)+,d4-7
rts
od_noport
move.l d7,a1
sub.l #34,a1
move.l d6,d0
add.l #34,d0
jsr _lvofreemem(a6)
bra.s od_nomsgmem
close_a_device
move.l 4.w,a6
movem.l d0/a1,-(sp)
jsr _lvoclosedevice(a6)
movem.l (sp)+,d0/a1
move.l mn_replyport(a1),a0
bsr deleteport
sub.l #34,a1
add.l #34,d0
jsr _lvofreemem(a6)
rts
createport
move.l 4.w,a6
; move.b d0,ln_pri(a0)
; move.l a1,ln_name(a0)
move.b #nt_msgport,ln_type(a0)
move.l a0,-(sp)
moveq #$ff,d0
jsr _lvoallocsignal(a6)
move.l (sp),a0
move.b d0,mp_sigbit(a0)
addq #1,d0
beq.s cp_error
sub.l a1,a1
jsr _lvofindtask(a6)
move.l (sp)+,a0
move.l d0,mp_sigtask(a0)
; move.l a0,a1
; jsr _lvoaddport(a6)
; move.l (sp)+,a0
moveq #$ff,d0
rts
cp_error
move.l (sp)+,a0
moveq #0,d0
rts
deleteport
movem.l d0/a1,-(sp)
move.l 4.w,a6
; move.l a0,-(sp)
; move.l a0,a1
; jsr _lvoremport(a6)
; move.l (sp)+,a0
move.b #$ff,ln_type(a0)
moveq #0,d0
move.b mp_sigbit(a0),d0
jsr _lvofreesignal(a6)
movem.l (sp)+,d0/a1
rts
endm